﻿using Idlesoft.Utils;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Xml;
using System.Xml.Serialization;

namespace UtilsTests
{
	
	
	/// <summary>
	///This is a test class for SerializationExtensionsTest and is intended
	///to contain all SerializationExtensionsTest Unit Tests
	///</summary>
	[TestClass()]
	public class SerializationExtensionsTest
	{


		private TestContext testContextInstance;

		/// <summary>
		///Gets or sets the test context which provides
		///information about and functionality for the current test run.
		///</summary>
		public TestContext TestContext
		{
			get
			{
				return testContextInstance;
			}
			set
			{
				testContextInstance = value;
			}
		}

		#region Additional test attributes
		// 
		//You can use the following additional attributes as you write your tests:
		//
		//Use ClassInitialize to run code before running the first test in the class
		//[ClassInitialize()]
		//public static void MyClassInitialize(TestContext testContext)
		//{
		//}
		//
		//Use ClassCleanup to run code after all tests in a class have run
		//[ClassCleanup()]
		//public static void MyClassCleanup()
		//{
		//}
		//
		//Use TestInitialize to run code before running each test
		//[TestInitialize()]
		//public void MyTestInitialize()
		//{
		//}
		//
		//Use TestCleanup to run code after each test has run
		//[TestCleanup()]
		//public void MyTestCleanup()
		//{
		//}
		//
		#endregion


		/// <summary>
		///A test for Deserialize
		///</summary>
		public void DeserializeTestHelper<TItem>()
		{
			string xmlOrFile = string.Empty; // TODO: Initialize to an appropriate value
			TItem expected = default(TItem); // TODO: Initialize to an appropriate value
			TItem actual;
			actual = SerializationExtensions.Deserialize<TItem>(xmlOrFile);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void DeserializeTest()
		{
			DeserializeTestHelper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for Deserialize
		///</summary>
		public void DeserializeTest1Helper<TItem>()
		{
			XmlReader reader = null; // TODO: Initialize to an appropriate value
			TItem expected = default(TItem); // TODO: Initialize to an appropriate value
			TItem actual;
			actual = SerializationExtensions.Deserialize<TItem>(reader);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void DeserializeTest1()
		{
			DeserializeTest1Helper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for Serialize
		///</summary>
		public void SerializeTestHelper<TItem>()
		{
			TItem item = default(TItem); // TODO: Initialize to an appropriate value
			XmlWriter writer = null; // TODO: Initialize to an appropriate value
			XmlSerializerNamespaces namespaces = null; // TODO: Initialize to an appropriate value
			SerializationExtensions.Serialize<TItem>(item, writer, namespaces);
			Assert.Inconclusive("A method that does not return a value cannot be verified.");
		}

		[TestMethod()]
		public void SerializeTest()
		{
			SerializeTestHelper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for Serialize
		///</summary>
		public void SerializeTest1Helper<TItem>()
		{
			TItem item = default(TItem); // TODO: Initialize to an appropriate value
			XmlSerializerNamespaces namespaces = null; // TODO: Initialize to an appropriate value
			string expected = string.Empty; // TODO: Initialize to an appropriate value
			string actual;
			actual = SerializationExtensions.Serialize<TItem>(item, namespaces);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void SerializeTest1()
		{
			SerializeTest1Helper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for Serialize
		///</summary>
		public void SerializeTest2Helper<TItem>()
		{
			TItem item = default(TItem); // TODO: Initialize to an appropriate value
			string file = string.Empty; // TODO: Initialize to an appropriate value
			XmlSerializerNamespaces namespaces = null; // TODO: Initialize to an appropriate value
			SerializationExtensions.Serialize<TItem>(item, file, namespaces);
			Assert.Inconclusive("A method that does not return a value cannot be verified.");
		}

		[TestMethod()]
		public void SerializeTest2()
		{
			SerializeTest2Helper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for Serializer
		///</summary>
		public void SerializerTestHelper<TItem>()
		{
			XmlSerializer expected = null; // TODO: Initialize to an appropriate value
			XmlSerializer actual;
			actual = SerializationExtensions.Serializer<TItem>();
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void SerializerTest()
		{
			SerializerTestHelper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for Namespaces
		///</summary>
		[TestMethod()]
		public void NamespacesTest()
		{
			XmlSerializerNamespaces actual;
			actual = SerializationExtensions.Namespaces;
			Assert.Inconclusive("Verify the correctness of this test method.");
		}
	}
}
